package com.wedimob.plugins;

import java.util.Iterator;
import java.util.Map;
import java.util.Set;

/**
 * Plugins lifecycle management
 * 
 * @author melouadi
 * 
 */
public interface LifeCyclePluginManager {
	
	/**
	 * all available directory
	 * 
	 */
	Iterator<SimplePlugin> all(PluginType type);
	
	/**
	 * installed plugin
	 * 
	 */
	Iterator<SimplePlugin> installed(PluginType type);
	
	/**
	 * install a plugin
	 * 
	 * @param plugins
	 *            to install
	 */
	void install(Set<SimplePlugin> plugins);

	/**
	 * update a plugin
	 * 
	 * @param plugins
	 *            to update
	 */
	void update(Set<SimplePlugin> plugins);

	/**
	 * remove a plugin
	 * 
	 * @param plugins
	 *            to remove
	 */
	void desinstall(Set<SimplePlugin> plugins);

	/**
	 * Deactivate a plugin
	 * 
	 * @param plugins
	 *            to deactivate
	 */
	void disable(Set<SimplePlugin> plugins);

	/**
	 * Activate a plugin
	 * 
	 * @param plugins
	 *            to activate
	 */
	void enable(Set<SimplePlugin> plugins);

	/**
	 * Check if plugin is activated
	 * 
	 * @param plugins
	 *            to check
	 * @return activation status
	 */
	Map<SimplePlugin, Boolean> enabled(Set<SimplePlugin> plugins);

	/**
	 * Deactivate a plugin auto update
	 * 
	 * @param plugins
	 *            to deactivate auto update
	 */
	void disableAutoUpdate(Set<SimplePlugin> plugins);

	/**
	 * Activate a plugin auto update
	 * 
	 * @param plugins
	 *            to activate auto update
	 */
	void enableAutoUpdate(Set<SimplePlugin> plugins);

	/**
	 * Check if plugin is auto updatable
	 * 
	 * @param plugins
	 *            to check
	 * @return activation status
	 */
	Map<SimplePlugin, Boolean> autoUpdateEnabled(Set<SimplePlugin> plugins);
}
